home *** CD-ROM | disk | FTP | other *** search
- property numPieces, piecesSolved, oneSolvedSound, allSolvedSound, ResetButton, piecesIn, activePiece
-
- on pieceAdded me
- set piecesIn to piecesIn + 1
- turnON(ResetButton)
- end
-
- on pieceRemoved me
- set piecesIn to piecesIn - 1
- if piecesIn = 0 then
- turnOff(ResetButton)
- end if
- end
-
- on pieceSolved me
- set piecesSolved to piecesSolved + 1
- if piecesSolved = numPieces then
- allSolvedAction(me)
- else
- rightSound(me)
- end if
- end
-
- on pieceUnsolved me
- set piecesSolved to piecesSolved - 1
- end
-
- on newActivePiece me, xPiece
- if objectp(activePiece) then
- unHighlight(activePiece)
- end if
- set activePiece to xPiece
- highlight(activePiece)
- end
-
- on new me, xInt
- set numPieces to xInt
- set piecesSolved to 0
- return me
- end
-
- on linkUp me, xButton
- set ResetButton to xButton
- turnOff(ResetButton)
- end
-
- on allSolvedAction me
- global pieceList, fixedPieceList, infoBox
- rightSound(me)
- repeat with i in pieceList
- destroy(i)
- end repeat
- set pieceList to []
- repeat with i in fixedPieceList
- destroy(i)
- end repeat
- set fixedPieceList to []
- stringEvent(infoBox, "DNA und Mutationen")
- go(label("rewardFrame"))
- end
-
- on rightSound me
- set the volume of sound 1 to 255
- puppetSound("rightSound")
- updateStage()
- end
-
- on wrongSound me
- set the volume of sound 1 to 255
- puppetSound("wrongSound")
- updateStage()
- end
-